import {createBrowserRouter, Navigate} from 'react-router-dom'
import Home from '../pages/home/Home'
import Index from '../pages/index/Index'
import List from '../pages/list/List'
import Login from '../pages/login/Login'
import Error from '../pages/404/Index'
import Chaxun from '../pages/chaxun/Chaxun'
export const homeRoutes=[
    {
        path:'/home/index',
        element:<Index></Index>,
        title:'列表页',
        children:[
            {
                path:'/home/index/list',
                element:<List></List>,
                title:'卡片列表'
            },
            {
                path:'/home/index/chaxun',
                element:<Chaxun></Chaxun>,
                title:'查询列表'
            }
        ]
    },
    
]
const routes=createBrowserRouter([
    {
        path:'/',
        element:<Navigate to='/home/index'></Navigate>
    },
    {
        path:'/home',
        element:<Home></Home>,
        children:homeRoutes
    },
    {
        path:'/login',
        element:<Login></Login>
    },
    {
        path:'*',
        element:<Error></Error>
    }
])

export default routes